package oop.memory;

/**
 * Created with IntelliJ IDEA.
 * ClassName: PersonTest
 * Package: oop.memory
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-10
 * Time: 15:00
 */

public class PersonTest {
    public static void main(String[] args) {

        //类的实例化
        Person p1 = new Person();

        //通过对象调用属性和方法
        p1.name = "杰克";
        p1.age = 24;
        p1.gender = '男';

        System.out.println("name = " + p1.name + ",age = " + p1.age + ",gender = " + p1.gender);

        p1.eat();
        p1.sleep(8);
        p1.interests("画画");

        //还可以创建另一个对象
        Person p2 = new Person();
        p2.name = "露丝";
        p2.age = 18;
        p2.gender = '女';

        System.out.println("name = " + p2.name + ",age = " + p2.age + ",gender = " + p2.gender);


        //内存解析的问题

    }
}
